package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @NAME: AccountController
 * @USER: Administrator
 * @DESCRIPTION:
 **/
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @PostMapping("/account/delcreate")
    public CommonResult delcreate(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money){

        accountService.delcreate(userId,money);
        return new CommonResult(200,"扣除余额成功！");
    }
}
